<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>26.组件定义自己的事件</title>


</head>
<body>
<div id="app">
    <login></login>
</div>


<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    const login ={
        template: "<div><h1>{{name}}</h1><input type='button' value='点击我修改名称' @click='change'></div>",
        data() {
            return {
                name: "john"
            };
        },
        methods:{
            change() {
                this.name = "micheal";
            }
        }
    }
    const app = new Vue({
        el: '#app',
        data: {},
        methods: {},
        components: {login}
    });
</script>
</body>
</html>